﻿using SqlKata;

namespace Zws.Dapper
{
    public static class SqlKataExtenstion
    {
        public static Query WhereIf(this Query query, bool isHolds, string column, string op, object value)
        {
            return isHolds ? query.Where(column, op, value) : query;
        }
        public static Query WhereIf(this Query query, bool isHolds, string column, object value)
        {
            return query.WhereIf(isHolds, column, "=", value);
        }
        public static Query WhereLikeIf(this Query query, bool isHolds, string column, object value)
        {
            return isHolds ? query.WhereLike(column, value) : query;
        }
        public static Query WhereNotIf(this Query query, bool isHolds, string column, object value)
        {
            return isHolds ? query.WhereNot(column, value) : query;
        }
    }
}
